SELECT COUNT(1)
FROM FD_DOMAIN_NA T
WHERE 1                    =1
<#if (CODE!) != ''>
  AND (INSTR (T.CODE, :CODE )> 0
  OR INSTR (T.NAME, :CODE )    > 0)
</#if>
<#if (SITE_ID!) != ''>
  AND T.SITE_ID              = :SITE_ID
</#if>